﻿#include "test4ErrorDetection.h"

int test4ErrorDetection() {
	int a, b;
	
	try
	{
		std::cin >> a >> b;
		if (b == 0)
			throw std::exception("除数不能为0.");

		int re = a / b;
		std::cout << re << std::endl;
	}
	catch (const std::exception& e)
	{
		std::cout << e.what() << std::endl;
	}
	
	std::cout << "program is still running. " << std::endl;
	return 0;
}